﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace PaggerApplication.Models {
    public class PageViewModel<T> where T : class {

        public PageViewModel () {
            this.Data = new List<T> ();
        }

        public IEnumerable<T> Data { get; set; }

        public int PageIndex { get; set; }

        public int RowCount { get; set; }

        public int PageSize { get; set; }

        public int PageCount {
            get {
                return PageSize > 0 ? ( RowCount % PageSize == 0 
                    ? RowCount / PageSize : RowCount / PageSize + 1 ) : 0;
            }
        }
    }
}